package cn.joker.config;

import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import org.springdoc.core.models.GroupedOpenApi;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class Knife4jConfig {

    @Bean
    public OpenAPI customOpenAPI() {
        return new OpenAPI()
            .info(new Info()
                .title("权限模块接口文档")
                .version("1.0")
                .description("microservice-auth 模块的接口文档")
                .contact(new Contact()
                    .name("joker")
                    .email("you@example.com")
                    .url("https://your-domain.com")
                )
            );
    }
    @Bean
    public GroupedOpenApi publicApi() {
        return GroupedOpenApi.builder()
                .group("user-api")
                .packagesToScan("cn.joker.controller") // 改为你自己的 controller 包路径
                .build();
    }

}
